home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0095_Detect EGA-VGA in ASM.pas < prev    next >
Pascal/Delphi Source File  |  1994-02-03  |  783b  |  44 lines

  1. program EGAORVGA;
  2. {For TP 6.0 because of assembler code.  Put these functions into a UNIT
  3.  for general use.}
  4.  
  5.   FUNCTION IsEGAorVGA : Boolean; Assembler;
  6.   ASM
  7.     MOV AH, 12h
  8.     MOV BL, 10h
  9.     INT 10h
  10.     MOV AL, 0
  11.     CMP BH, 1
  12.     JA @Nope
  13.     CMP BL, 3
  14.     JA @Nope
  15.     INC AL
  16.     @Nope:
  17.   END;
  18.  
  19.   FUNCTION IsVGA : Boolean; Assembler;
  20.   ASM
  21.     MOV AH, 12h
  22.     MOV AL, 00h
  23.     MOV BL, 36h
  24.     INT 10h
  25.     MOV AH, 0
  26.     CMP AL, 12h
  27.     JNZ @Nope
  28.     INC AH
  29.     @Nope:
  30.   END;
  31.  
  32. begin
  33.   If IsEGAorVGA then
  34.   begin
  35.     Writeln('Programs supporting EGA or VGA will run on this computer.');
  36.     If IsVGA then
  37.       Writeln('VGA detected.')
  38.     Else
  39.       Writeln('EGA detected.')
  40.   end
  41.   Else
  42.       Writeln('No EGA or VGA detected!');
  43. end.
  44.